package dapps.dao.document;

import java.util.List;

import org.springframework.stereotype.Repository;
import org.springside.modules.orm.hibernate.HibernateDao;

import dapps.entity.document.Attachment;

/**
 */
//Spring DAO Bean的标识
@Repository
public class AttachmentDao extends HibernateDao<Attachment, Long> {

	private static final String QUERY_BY_DOC_HQL = "select attachment from Attachment attachment  where attachment.doc.id=?";

	/**
	 * 查找拥有指定角色的用户.
	 */
	public List<Attachment> getFilesByDoc(Long docid) {
		return find(QUERY_BY_DOC_HQL, docid);
	}

	

}
